package testview.zhen.com.myapplication.mvp.base;

import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

/**
 * Create by ldr
 * on 2019/8/7 17:32.
 */
public abstract class BaseMVPActivity<T extends BasePresenter> extends AppCompatActivity {

    protected  T mPresenter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initPresenterAndView();

    }


    @Override
    protected void onDestroy() {
        if (mPresenter != null){
            mPresenter.detachView();
        }
        super.onDestroy();
    }

   public abstract void initPresenterAndView();


}
